﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LeafHttp
{
    /// <summary>
    /// Http请求的拦截器接口
    /// </summary>
    public interface IRequestInterceptor
    {
        /// <summary>
        /// 发起请求时
        /// </summary>
        /// <param name="config"></param>
        void Request(RequestConfig config);
        /// <summary>
        /// 请求出错时
        /// </summary>
        /// <param name="ex"></param>
        void RequestError(Exception ex);
        /// <summary>
        /// 收到响应时
        /// </summary>
        /// <param name="response"></param>
        void Response(ResponseResult response);
        /// <summary>
        /// 响应出错时
        /// </summary>
        /// <param name="error"></param>
        void ResponseError(ErrorResult error);
    }
}
